<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
<style type="text/css">


/* Hide overlay markup while loading, if js is enabled */
.yui3-js-enabled .yui3-overlay-loading {
    top:-1000em;
    left:-1000em;
    position:absolute;
}

/* Overlay Look/Feel */
.yui3-overlay-content {
    background-color: #ECEFFB;  
    border: 1px solid #9EA8C6;
    border-radius: 3px;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.25);
}

.yui3-overlay-content .yui3-widget-hd {
    background-color: #B6BFDA;  
    color: #30418C;
    font-size: 120%;
    font-weight: bold;
    padding: 0.2em 0.5em 0.3em;
    border-radius: 2px 2px 0 0;
}

.yui3-overlay-content .yui3-widget-bd {
    padding: 0.4em 0.6em 0.5em;
}

.yui3-overlay-content .yui3-widget-ft {
    background-color:#DFE3F5;
    padding: 0.4em 0.6em 0.5em;
    border-radius: 0 0 2px 2px;
}

</style>
<script type="text/javascript">

YUI().use('node','dump','escape','overlay',function(Y) {
	
	var a = Y.WidgetPositionAlign;
	
    var shareModeOverLay = new Y.Overlay({
        srcNode:"#share-mode-overlay",
        width:"27em",
        height:"2.5em"
    });
    shareModeOverLay.render();
    shareModeOverLay.set("align", {/*node:'#project-app',*/points:[a.TC, a.TC]});
    shareModeOverLay.show();

	var urlr = /(https?:\/{2}){1}(([-a-zA-Z0-9]{1,25}\.){1,4}[-a-zA-Z0-9]{1,4}(:\d{1,6})?([-a-zA-Z0-9@:%_\+.~#?&\/=]{0,256})?)/gi;
	
	var str = "abc http://www.51dir.com uuvhttp://www.google.com ";
	/*
	Y.log(urlr.exec(str));
	Y.log(urlr.index);
	Y.log(urlr.lastIndex);
	Y.log(urlr.exec(str));
	Y.log(urlr.index);
	Y.log(urlr.lastIndex);
	Y.log(urlr.exec(str));
	Y.log(urlr.index);
	Y.log(urlr.lastIndex);
	Y.log(urlr);
	Y.log('a');
	*/
	var kc = Y.one('#keyc'); 
	
	kc.on('viewportRegionChange',function(e){
		Y.log(Y.dump(e.newVal));
	});
	Y.log(kc.get('winHeight'));
	Y.log(kc.get('winWidth'));
	Y.log(kc.get('docHeight'));
	Y.log(kc.get('docWidth'));
	Y.on('scroll',function(e){
//		e.preventDefault();
/*
		Y.log(kc.get('docScrollX'));
		Y.log(kc.get('docScrollY'));
		Y.log(Y.dump(kc.get('viewportRegion')));
		Y.log(Y.dump(kc.get('region')));
*/		
		shareModeOverLay.set("align", {/*node:'#project-app',*/points:[a.TC, a.TC]});
	});
	
	var assetr = / +\/asset\/\d+(\.\w?)?/gi;
	
	Y.log(assetr.exec(' /asset/1'));
	var s = "12345<67890abcd<efghijkl<mnopqrs<tuvwxyz123456";
//	for(var i=0;i<105;i++){
//		s += "a";
//	}
	Y.log(s.length);
	
	Y.on('change',function(e){
		Y.log(e);
	},'#keyc');
	
	var aa = [[33,36],[2,8],[11,20],[23,30]];
	Y.log(sanitize(s,aa));
	
	function sanitize(s,aa){
		var i = 0;
		for(var i=1;i<aa.length;i++){
		       for(var j=0;j<i;j++){
		           if(aa[i][0]<aa[j][0]){
		           		var temp = aa[i];
		           		aa[i]=aa[j];
		           		aa[j]=temp;
		           }
		       }
		   }
		var aa1 = [];
		var lastend = 0;
		i = 0;
		for(var i=0;i<aa.length;i++){
			aa1.push([lastend,aa[i][0]]);
			lastend = aa[i][1];
		}
		var ss = "";
		i = 0;
		for(;i<aa.length;i++){
			ss += Y.Escape.html(s.substring(aa1[i][0],aa1[i][1]));
			ss += s.substring(aa[i][0],aa[i][1]);
			Y.log(ss);
		}
		ss += s.substr(aa[i-1][1]);
		return ss;
	}
});

</script>
</head>
<body  class="yui3-skin-sam">

<div id="share-mode-overlay" class="yui3-overlay-loading">
    <div class="yui3-widget-bd">此刻是共享模式，您可以创建自己的全功能的--><a href="/workflow.html">有序</a></div>
</div>

<script type="text/javascript">

var str = "Visit W3School"; 
var patt = new RegExp("W3School","g");
var result;

while ((result = patt.exec(str)) != null)  {
  document.write(result);
  document.write("<br />");
  document.write(result.lastIndex);
 }
</script>
<ul>
	<li>
		<table><tr><td>a</td></tr></table>
		<ul>
			<li>
			<table><tr><td>aa</td></tr></table>
			</li>
		</ul>
	</li>
</ul>
<form>
<a href="#" id="ttt">ttt</a>
<div id="keyc">
<textarea rows="" cols="" id="mytextarea" tabindex="1"></textarea>
</div>
</form>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>

<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>

<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>

<p>12312312312312312312312312312312312312312312</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>

<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>

<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>

<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>
<p>123</p>

</body>
</html>